import http from "@/api/request";

export const MenuApi = () => {
	const fetchList = (params = {}) => {
		return http.get("backend/menu/list", { ...params });
	};
	const createComponent = (params = {}) => {
		return http.post("backend/menu/create-route-file", { ...params }, { config: { noLoading: false, sendOriginalData: false } });
	};
	const deleteMenu = (params = {}) => {
		return http.delete("backend/menu/delete", { ...params });
	};
	const updateMenu = (params = {}) => {
		return http.post("backend/menu/update", { ...params });
	};
	const createMenu = (params = {}) => {
		return http.post("backend/menu/create", { ...params });
	};
	return {
		fetchList,
		createComponent,
		deleteMenu,
		updateMenu,
		createMenu
	};
};
